package cn.jingyuan.swan.cloud.web.client;

import org.springframework.http.client.ClientHttpResponse;
import org.springframework.web.client.ResponseErrorHandler;

import java.io.IOException;

/**
 * 默认 RestTemplate 异常处理
 */
public class NoErrorResponseErrorHandler implements ResponseErrorHandler {

    @Override
    public boolean hasError(ClientHttpResponse response) throws IOException {
        // false：指示 response 的 status 无论是多少都没有错误
        return false;
    }

    @Override
    public void handleError(ClientHttpResponse response) throws IOException {
        // default implementation ignored
    }

}
